﻿Imports System.Data.Linq
Imports System.Linq

Public Class MVoyage
    Private db As New TanNamChinhDataContext
    Public Function getVoyaList(ByVal id As Integer) As IQueryable
        Try
            Dim query = From v In db.tblVoyages
                         Where v.ID_Voyage = id
                        Select v.ID_Voyage
            Return query
        Catch ex As Exception
            Throw ex
        End Try
    End Function
    Public Function getIDVoyage(ByVal pol As Integer, ByVal pod As Integer, ByVal etd As String, ByVal eta As String) As Integer
        Try
            Dim query = (From v In db.tblVoyages
                        Where v.ID_POD = pod And v.ID_POL = pol And v.ETD = etd And v.ETA = eta
                        Select v.ID_Voyage).First
            Return query
        Catch ex As Exception
            Throw ex
        End Try
    End Function
    
End Class
